package com.example.swordkotlin

/**
 * @Author weiwei
 * @Date 2023/11/3 14:49
 */
object Test3 {
    lateinit var sas :Test3

    @JvmStatic
    fun main(args: Array<String>) {



        if (::sas.isInitialized) {
            print(sas)
        }
        print(1234)
        println(1234)
        println(1234)
//        var map = HashMap<Int,Int>()
//        map.put(1,1)
//        map.put(2,2)
//        map.put(3,3)
//        map.put(4,4)
//        map.put(5,5)
//
        val a = intArrayOf(2, 3, 1, 0, 2, 5, 3)
        for (i in a) {
            println(a[i])
        }
        for (i in a.indices) {

        }

        test(1, ::test2)


        val c :Int = 1
    }

    var test3 =  { x: Int, y: Int -> x + y }


    fun test(test: Int, aaa: () -> Unit) {

        var v = aaa()

        println("test finish")

    }



    fun test2() {
        println("test2......")
    }

    private fun test1() {
        println("test1.......")
    }

    fun duplicate(numbers: IntArray): Int {
        var map = HashMap<Int, Int>()
        for (i in numbers.indices) {
            if (map.containsKey(numbers[i])) {
                return numbers[i]
            } else {
                map[numbers[i]] = 1
            }
        }
        return -1
    }
}